﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Ymatou.ServiceCenter
{
    internal static class Logger
    {
        private static string Prefix = "RPC,AppId:" + "AppId".GetAppSettingsValue<string>();

        public static void Info(string message)
        {
            if(string.IsNullOrWhiteSpace(message))
                return;
            //ApplicationLog.Info(string.Format("{0},{1}",Prefix,message));
        }

        public static void Debug(string message)
        {
            if (string.IsNullOrWhiteSpace(message))
                return;
            if (Utils.GetEnableWriteRpcDebugLog())
                return;//ApplicationLog.Debug(string.Format("{0},{1}", Prefix, message));
        }

        public static void Error(string message)
        {
            if (string.IsNullOrWhiteSpace(message))
                return;
            //ApplicationLog.Error(string.Format("{0},{1}", Prefix, message));
        }

        public static void Error(string message, Exception ex)
        {
            if (string.IsNullOrWhiteSpace(message))
                message=string.Empty;
            //ApplicationLog.Error(string.Format("{0},{1}", Prefix, message),ex);
        }

        public static void Warn(string message)
        {
            if (string.IsNullOrWhiteSpace(message))
                return;
            //ApplicationLog.Warn(string.Format("{0},{1}", Prefix, message));
        }

        public static void Warn(string message, Exception ex)
        {
            if (string.IsNullOrWhiteSpace(message))
                message = string.Empty;
            //ApplicationLog.Warn(string.Format("{0},{1}", Prefix, message), ex);
        }

    }
}
